﻿@using Controllers
@using Models
@using PetaPoco
@using Controllers
@{
    var func=new MyFunc();
}
<!DOCTYPE html>
<html>
<head>
@Html.Partial("_top")
</head>
<body>
@Html.Partial("_header")
<div class="mainbg">
	<div class="w1200 mt20 cl">
		<div class="w260 fl">		
@{var leftclass=1;
var leftclassmodel=func.GetClass(leftclass);
}
<h1 class="tit_2 fs16 fb">@leftclassmodel.title</h1>
<ul class="nav_1">
@{var lists=func.GetCList(0,@leftclass);}

@for(var i=0;i<lists.Count;i++){	
  var item=lists[i];
  var url="/list/"+item.ID;
				<li><a href="@url" title="@item.title">@item.title</a></li>		
					}
</ul>
<h1 class="tit_2 fs16 fb mt10"><a href="/list/9">通知公告</a></h1>
<ul class="newl_2">
			@{var tzgg=func.GetList(8,9,"");}
		@for(var i=0;i<tzgg.Count;i++){	
		  var item=tzgg[i];
		  var url=string.IsNullOrEmpty(item.url)?"/article/"+item.ID:item.url;
		  var target=string.IsNullOrEmpty(item.url)?"_selft":"_blank";
						<li><a href="@url" title="@item.title" traget="@target">
							@(item.title.Length>20?item.title.Substring(0,20):item.title)</a></li>		
							}
</ul>
<ul class="nav_2 mt20 cl">
	<li class="first"><a href="#" class="jzxx">局长信箱</a></li>
	<li><a href="#" class="wsts">网上投诉</a></li>
	<li class="last"><a href="#" class="yjjy">意见建议</a></li>
</ul>
		</div>
		<div class="w900 fr">
			<div class="newt_1 rel"><span class="abs fs16 fb">@ViewBag.model.title</span><h1>当前位置：@Html.Raw(ViewBag.model.cur)</h1></div>
			<ul class="newl_3 mt15">
					
					@{
    var page = Request.QueryString["page"];
    int p = 1;
	int pagesize=15;
    if (!string.IsNullOrEmpty(page))
    {
        p = Convert.ToInt32(page);
    }
    Page<cxinxiModel> pagelist=func.GetPageListKeySearch(p,pagesize,ViewBag.model.title);
}
@for(var i = 0;i<pagelist.Items.Count;i++)
				{				
				var item=pagelist.Items[i];						
				var url=string.IsNullOrEmpty(item.url)?"/article/"+item.ID:item.url;
				var target=string.IsNullOrEmpty(item.url)?"_self":"_blank";			
        <li><a href="@url" title="@item.title" target="@target">@item.title</a><span>@item.addtime.ToString("yyyy-MM-dd")</span></li>
				}
			</ul>
			
			<div class="page">
			<ul class="pagination">
					<li><a href="/list/@ViewBag.model.ID">首页</a></li>
					@for (int i = 0; i < pagelist.TotalPages; i++)
					{
						<li><a href="@Url.Action("List","Home",new {page=i+1})" @if(i==pagelist.CurrentPage){@Html.Raw("class=\"active\"");}>@(i+1)</a></li>
					}
				<li><a href="/list/@ViewBag.model.ID?page=@pagelist.TotalPages">尾页</a></li>
				<li><a>第 @pagelist.CurrentPage /@pagelist.TotalPages 页</a></li>
				<li><a>共 @pagelist.TotalItems 条</a></li>
			</ul>
			</div>
		</div>
	</div>
</div>

<div id="footer">
	@Html.Raw(ViewBag.model.copyright)
</div>
</body>
</html>